package swordoffer.offer05;

public class APISolution {
    public static void main(String[] args) {
        StringBuffer s = new StringBuffer("we are happy");
        String s1 = replaceSpace(s);
        System.out.println(s1);
    }
    public static String replaceSpace(StringBuffer str) {
        //String类型进行改变时，都会生成一个新的String对象。
        return str.toString().replace(" ", "%20");
    }
}
